<?php
include('../confing/common.php');
if($islogin!=1){exit("<script language='javascript'>window.location.href='login';</script>");  }
if($userrow['uid']!=1){exit("<script language='javascript'>window.location.href='login.php';</script>");}
$dd=$DB->count("select * from qingka_wangke_huoyuan where pt='daxiong' and name='大雄' ");
if ($dd==0) {
    exit("<script language='javascript'>alert('请添加一个接口，名称为“大雄”，标识为“daxiong”，否则无法使用此插件');window.location.href='/index/huoyuan';</script>");
}
?>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<title>一键对接上架大雄平台插件</title>
<meta name="keywords" content="一键对接上架大雄平台插件" />
<meta name="description" content="一键对接上架大雄平台插件" />
<link rel="icon" href="../favicon.ico" type="image/ico">
<meta name="author" content=" ">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/apps.css" type="text/css" />
<link rel="stylesheet" href="assets/css/app.css" type="text/css" />
<link rel="stylesheet" href="assets/layui/css/layui.css" type="text/css" />
<link href="http://cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
<link href="assets/LightYear/css/materialdesignicons.min.css" rel="stylesheet">
<link href="assets/LightYear/css/style.min.css" rel="stylesheet">
<script src="assets/js/bootstrap.min.js"></script>
<script src="//lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
<script src="layer/3.1.1/layer.js"></script>
</head>
     <div class="app-content-body ">
        <div class="wrapper-md control" id="orderlist">
	    <div class="panel panel-default" >
		    <div class="panel-heading font-bold bg-white">一键对接上架大雄平台插件&nbsp;<a class="btn btn-xs btn-success" href="/index/class">网课管理</a></div>
				 <div class="panel-body">
		      <div class="table-responsive">
		        <table class="table table-striped">
		          <thead><tr><th>操作</th><th>平台名字</th><th>对接ID</th><th>我的价格</th><th>状态</th></tr></thead>
		          <tbody>
		            <tr v-for="res in row.data">
		                <td><button class="btn btn-xs btn-primary" data-toggle="modal" data-target="#modal-update" @click="storeInfo=res">一键上架</button></td>   
		            	<td>{{res.name}}</td>
		            	<td>{{res.cid}}</td>
		            	<td>{{res.jiage}}</td>
		            	<td><span class="btn btn-xs btn-success" v-if="res.status==1">正常</span><span class="btn btn-xs btn-danger" v-else-if="res.status==0">下架</span></td>
		                 	
		            </tr>
		          </tbody>
		        </table>
		      </div>
		      
			     
		    </div>
		  </div>
  
        <div class="modal fade primary" id="modal-update">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span>
                        </button>
                        <h4 class="modal-title">一键上架课程</h4>
                    </div>
           
                    <div class="modal-body">
                        <form class="form-horizontal" id="form-add">
                            <input type="hidden" name="action" value="add"/>
                            <div class="form-group">
                               <label class="col-sm-3 control-label">排序</label>
                                <div class="col-sm-9">             
                                  <input type="text" name="sort" class="form-control"  placeholder="输入数字,不填默认10,商品排序从小到大">
                               </div>
                            </div>
                            <div class="form-group">
                               <label class="col-sm-3 control-label">课程名字</label>
                                <div class="col-sm-9">             
                                  <input type="text" name="name" class="form-control" :value="storeInfo.name" placeholder="输入平台名字">
                               </div>
                            </div>
                            <div class="form-group">
                               <label class="col-sm-3 control-label">价格倍数</label>
                                <div class="col-sm-9">             
                                  <input type="text" name="price" class="form-control" :value="storeInfo.price5" placeholder="输入价格">
                                  <font style="color:red">(价格倍数默认比对接站多0.5，其他自调)</font>
                               </div>
                            </div>
                            <div class="form-group">
                               <label class="col-sm-3 control-label">查询参数</label>
                                <div class="col-sm-9">             
                                  <input type="text" name="getnoun" class="form-control" :value="storeInfo.cid" placeholder="输入标识">
                               </div>
                            </div>
                            <div class="form-group">
                               <label class="col-sm-3 control-label">对接参数</label>
                                <div class="col-sm-9">             
                                  <input type="text" name="noun" class="form-control" :value="storeInfo.cid" placeholder="输入标识">
                               </div>
                            </div>
                            <div class="form-group">
                               <label class="col-sm-3 control-label">说明</label>
                                <div class="col-sm-9"> 
                                  <textarea name="content" class="form-control" :value="storeInfo.content" rows="3"></textarea>           
                               </div>
                            </div>
                            <div class="form-group">
                             	<label class="col-sm-3 control-label">查询平台</label>
	                            <div class="col-sm-9">                             	
		                            <select name="queryplat" class="form-control">
		                            	<?php
		                            	        $a=$DB->query("select * from qingka_wangke_huoyuan where pt='daxiong' and name='大雄'");
		                            		   	 while($b=$DB->fetch($a)){
		                            		   	 	echo '<option value="'.$b['hid'].'">'.$b['name'].'</option>';	
		                            		   	 }
		                            		   	 echo '<option value="0">自营</option>';	
		  	                            		$a=$DB->query("select * from qingka_wangke_huoyuan where pt!='daxiong' and name!='大雄'");
		                            		   	 while($b=$DB->fetch($a)){
		                            		   	 	echo '<option value="'.$b['hid'].'">'.$b['name'].'</option>';	
		                            		   	 }
										?>
		                            </select>
		                       </div>
	                       </div>
                           <div class="form-group">
                             	<label class="col-sm-3 control-label">对接平台</label>
                             	<div class="col-sm-9">   
	                            <select name="docking" class="form-control">
	                            	<?php
		                            	        $a=$DB->query("select * from qingka_wangke_huoyuan where pt='daxiong' and name='大雄'");
		                            		   	 while($b=$DB->fetch($a)){
		                            		   	 	echo '<option value="'.$b['hid'].'">'.$b['name'].'</option>';	
		                            		   	 }
		                            		   	 echo '<option value="0">自营</option>';	
		  	                            		$a=$DB->query("select * from qingka_wangke_huoyuan where pt!='daxiong' and name!='大雄'");
		                            		   	 while($b=$DB->fetch($a)){
		                            		   	 	echo '<option value="'.$b['hid'].'">'.$b['name'].'</option>';	
		                            		   	 }
										?>
	                            </select>
	                            </div>
                            </div>
                            <div class="form-group">
                            	<label class="col-sm-3 control-label">状态</label>
                            	<div class="col-sm-9">   
	                            <select name="status" class="form-control">
	                                <option value="1">上架</option>
	                                <option value="0">下架</option>
	                            </select>
	                            </div>
                            </div>
                                
                         </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-danger" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-success" @click="form('add')">确定</button>
                    </div>
                </div>
            </div>
        </div>
  
  
  
  
    </div>
   </div>
 </div>
 
 <script type="text/javascript" src="assets/LightYear/js/jquery.min.js"></script>
<script type="text/javascript" src="assets/LightYear/js/bootstrap.min.js"></script>
<script type="text/javascript" src="assets/LightYear/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="assets/LightYear/js/main.min.js"></script>
<script src="assets/js/aes.js"></script>
<script src="https://cdn.staticfile.org/vue/2.6.11/vue.min.js"></script>
<script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
<script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
<script type="text/javascript" src="assets/js/daxiong.js"></script>



  <script type="text/javascript">
    /* 鼠标特效 */
    var a_idx = 0;
    jQuery(document).ready(function($) {
        $("body").click(function(e) {
            var a = new Array("富强","民主","文明","和谐","自由","平等","公正","法治","爱国","敬业","诚信","友善");
            var $i = $("<span />").text(a[a_idx]);
            a_idx = (a_idx + 1) % a.length;
            var x = e.pageX
              , y = e.pageY;
            $i.css({
                "z-index": 999999999999999999999999999999999999999999999999999999999999999999999,
                "top": y - 20,
                "left": x,
                "position": "absolute",
                "font-weight": "bold",
                "color": "#ff6651"
            });
            $("body").append($i);
            $i.animate({
                "top": y - 180,
                "opacity": 0
            }, 1500, function() {
                $i.remove();
            });
        });
    });
</script>